package com.daedalus.Polimorfizmi.Shapes;

import java.awt.Graphics;


public class MyLine extends MyShape{

	int x2Coordinate;
	int y2Coordinate;
	
	public MyLine(int x, int y, int x2, int y2) {
		super(x, y);
		setX2Coordinate(x2);
		setY2Coordinate(y2);
	}

	public void setX2Coordinate(int x){
		x2Coordinate=x>0?x:10;
	}
	public void setY2Coordinate(int y){
		y2Coordinate=y>0?y:10;
	}
	public int getY2(){
		return y2Coordinate;
	}
	public int getX2(){
		return x2Coordinate;
	}
	
	@Override
	public void paint(Graphics g) {
		g.drawLine(getX(), getY(), getX2(), getY2());
		
	}

}
